import {Component, OnInit, OnDestroy, Input, Output, EventEmitter, OnChanges,SimpleChanges} from '@angular/core';
@Component({
    selector: 'pl-left',
    templateUrl: 'pl-left.component.html',
    styleUrls: ['pl-left.component.scss'],
})
export class PlLeftComponent implements OnInit, OnDestroy,OnChanges{

    @Input() index;
    @Input() item;
    @Output() itemChange = new EventEmitter<any>();
    constructor() {
    }

    ngOnInit() {

    }

    ngOnChanges(changes:SimpleChanges){
      // console.log(changes,20);
      if(changes.hasOwnProperty('index')){
        this.getNavList();
      }
    }

    setItem(item){
      this.item = item;
      this.itemChange.emit(item);
    }

    getNavList(){
      // console.log(this.index,23);
    }

    ngOnDestroy() {

    }
}
